Skip to content

Refactor super() usage in classes #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

soulee-dev
Copy link
Contributor

Description

This PR addresses the use of the super() function in the classes. Starting with Python 3, super() can be called without arguments in instance methods, automatically determining the class and self. This PR applies this simplification, enhancing the code's readability and maintainability.

Changes

  • Replaced all occurrences of super(ClassName, self).__init__ with the simplified super().__init__ in the classes.

Before

super(ClassName, self).__init__(from_packet, event_size, table_map) ...

After

super().__init__(from_packet, event_size, table_map) ...

Benefits

  • Readability: The new syntax is cleaner and more in line with modern Python practices.
  • Maintainability: If the class name changes in the future, there's no need to update the call to super().

Related Issue

Fixed: #432

@dongwook-chan
Copy link
Collaborator

The modifications have greatly boosted the readability of the code. It's not just clearer but also more concise.

@julien-duponchelle
Copy link
Owner

Great

@julien-duponchelle julien-duponchelle merged commit 07ad978 into julien-duponchelle:main Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use simplified super() calling in classes
3 participants